package com.ddxz.demo.quartz.service.impl;

import com.ddxz.demo.quartz.service.TaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * class description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2020/11/24
 */

@Service
public class TaskServiceImpl implements TaskService {
    @Async
    @Override
    public void startUpload(int i) {
        logger.info("task {} starting...", i);
        try{
            Thread.sleep(2000);
        } catch (InterruptedException ie) {
            logger.error("error ", ie);
        }
    }

    private static final Logger logger = LoggerFactory.getLogger(TaskServiceImpl.class);
}
